//
//  THOtherUserInfoUserListTableViewCell.m
//  TreeHole
//
//  Created by wang on 2020/12/3.
//  Copyright © 2020 stoneobs. All rights reserved.
//

#import "THOtherUserInfoUserListTableViewCell.h"

@interface THOtherUserInfoUserListTableViewCell()
@property(nonatomic, strong) UIImageView                     *iconImageView;/**<  */
@property(nonatomic, strong) STLabel                     *nameLable;/**<  */
@property(nonatomic, strong) STLabel                     *sexLable;/**<  */
@end
@implementation THOtherUserInfoUserListTableViewCell

- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    if (self == [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
        [self stoneobs_ui_configSubView];
    }
    return self;
}
+ (CGFloat)stoneobs_ui_cell_height{
    return 60;
}
#pragma mark --configSubView
- (void)stoneobs_ui_configSubView{
    UIImageView * stoneobs_ui_imageView = [[UIImageView alloc] initWithFrame:CGRectMake(10, 10, 40, 40)];
    stoneobs_ui_imageView.image = [UIImage imageNamed:@"ic_none"];
    [self addSubview:stoneobs_ui_imageView];
    stoneobs_ui_imageView.layer.cornerRadius = 20;
    stoneobs_ui_imageView.clipsToBounds = YES;
    self.iconImageView = stoneobs_ui_imageView;
    ({
        STLabel * stoneobs_ui_label = [[STLabel alloc] initWithFrame:CGRectMake(stoneobs_ui_imageView.right+10, 0, 200, 20)
                                                                text:@""
                                                           textColor:STONEOBS_UI_FIRST_TEXT_COLOR
                                                                font:15
                                                         isSizetoFit:NO
                                                       textAlignment:NSTextAlignmentLeft];
        [self addSubview:stoneobs_ui_label];
        self.nameLable = stoneobs_ui_label;
        
        stoneobs_ui_label.top = self.iconImageView.top;
    });
    
    
    ({
        STLabel * stoneobs_ui_label = [[STLabel alloc] initWithFrame:CGRectMake(stoneobs_ui_imageView.right+10, 0, 200, 20)
                                                                text:@""
                                                           textColor:STONEOBS_UI_FIRST_TEXT_COLOR
                                                                font:12
                                                         isSizetoFit:NO
                                                       textAlignment:NSTextAlignmentLeft];
        [self addSubview:stoneobs_ui_label];
        self.sexLable = stoneobs_ui_label;
        stoneobs_ui_label.bottom = self.iconImageView.bottom;
    });

}
- (void)setUserModel:(THUserModel *)userModel{
    _userModel = userModel;
    [self.iconImageView sd_setImageWithURL:userModel.header_img.mj_url];
    self.nameLable.text = userModel.name;
    self.sexLable.text = [NSString stringWithFormat:@"性别:男  简介:%@",userModel.brief];
    if (userModel.sex.intValue != 1) {
        self.sexLable.text = [NSString stringWithFormat:@"性别:女  简介:%@",userModel.brief];
    }
}
@end
